package com.adjaisd.scarecrow.testJava;

import com.adjaisd.scarecrow.dto.HeapPoint;
import com.adjaisd.scarecrow.dto.TrendPoint;
import com.adjaisd.scarecrow.service.ReportService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class testReport {

    @Autowired
    ReportService reportService;

    @Test
    void testGetAlarmTrend() {
        Long userId = 1L;
        String beg = "2022-04-01";
        String end = "2022-04-20";
        List<TrendPoint> alarmTrend = reportService.getAlarmTrend(userId, beg, end, 2);
        for (TrendPoint trendPoint : alarmTrend) {
            System.out.println(trendPoint);
        }
    }

    @Test
    void testGetTop10Alarm() {
        Long userId = 1L;
        String beg = "2022-04-01";
        String end = "2022-04-20";
        List<HeapPoint> top10Alarm = reportService.getTop10Alarm(userId, beg, end);
        for (HeapPoint heapPoint : top10Alarm) {
            System.out.println(heapPoint);
        }
    }

}
